<%--
 * 
 * @author yangxc
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE HTML>
<html>
<head>
    <title>注册client</title>
    <script src="${contextPath}/resources/angular.min.js"></script>
</head>
<body>
<h2>注册</h2>

<div ng-app>
<p class="help-block">
    注册申明：

</p>

<div ng-controller="RegisterClientCtrl">
        <form:form commandName="oAuthClients" cssClass="form-horizontal">
            <div class="form-group">
                <label for="clientId" class="col-sm-2 control-label">client_id<em class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="clientId" cssClass="form-control" id="clientId" placeholder="client_id"
                                required="required"/>
                    <p class="help-block">client_id必须输入,且必须唯一,长度至少5位; 在实际应用中的另一个名称叫appKey,与client_id是同一个概念.</p>
                </div>
            </div>
            <div class="form-group">
                <label for="clientSecret" class="col-sm-2 control-label">client_secret<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="clientSecret" cssClass="form-control" id="clientSecret"
                                placeholder="client_secret" required="required"/>

                    <p class="help-block">client_secret必须输入,且长度至少8位; 在实际应用中的另一个名称叫appSecret,与client_secret是同一个概念.</p>
                </div>
            </div>
            <div class="form-group">
                <label for="boundIp" class="col-sm-2 control-label">绑定IP<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="boundIp" cssClass="form-control" id="boundIp"
                                placeholder="bound_ip" required="required"/>

                    <p class="help-block">bound_ip必须输入,多个IP间用逗号隔开最多能填5个</p>
                </div>
            </div>
            <div class="form-group">
                <label for="company" class="col-sm-2 control-label">公司<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="company" cssClass="form-control" id="company"
                                placeholder="company" required="required"/>

                    <p class="help-block">公司必须输入</p>
                </div>
            </div>
            <div class="form-group">
                <label for="appName" class="col-sm-2 control-label">应用名称<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="appName" cssClass="form-control" id="appName"
                                placeholder="app_name" required="required"/>

                    <p class="help-block">应用名称必须输入</p>
                </div>
            </div>
            <div class="form-group">
                <label for="contacts" class="col-sm-2 control-label">联系人<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="contacts" cssClass="form-control" id="contacts"
                                placeholder="contacts" required="required"/>

                    <p class="help-block">联系人必须输入</p>
                </div>
            </div>
            <div class="form-group">
                <label for="tel" class="col-sm-2 control-label">联系电话<em
                        class="text-danger">*</em></label>

                <div class="col-sm-10">
                    <form:input path="tel" cssClass="form-control" id="tel"
                                placeholder="tel" required="required"/>

                    <p class="help-block">联系电话必须输入,需要输入区号。如：0512XXXXXXXX</p>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-2"></div>
                <div class="col-sm-10">
                    <form:errors path="*" cssClass="text-danger"/>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-2"></div>
                <div class="col-sm-10">
                    <button type="submit" class="btn btn-success">注册</button>
                    <a href="${contextPath}/clients/manage">取消</a>
                </div>
            </div>
        </form:form>
    </div>
</div>

<script>
    var RegisterClientCtrl = ["$scope", function ($scope) {
        $scope.visible = false;

        $scope.showMore = function () {
            $scope.visible = !$scope.visible;
        };
    }];
</script>
</body>
</html>